﻿using Microsoft.Extensions.Configuration;
using System;

namespace ProjectManageSystemApi
{
    public class Config
    {
        IConfiguration _configuration { get; }
        public Config(IConfiguration configuration)
        {
            _configuration = configuration;
        }

        #region JWT
        internal string Issuer => _configuration.GetValue<string>("Jwt:Issuer");
        internal string Audience => _configuration.GetValue<string>("Jwt:Audience");
        internal string SecurityKey => _configuration.GetValue<string>("Jwt:SecurityKey");
        internal int Expires => _configuration.GetValue<int>("Jwt:Expires");
        internal int ExtraExpires => _configuration.GetValue<int>("Jwt:ExtraExpires");
        #endregion

        #region 密码
        internal string PwdSuffix => _configuration.GetValue<string>("Pwd:Suffix");
        #endregion

        #region 文件上传路径

        internal string PublicPath => _configuration.GetValue<string>("UploadPath:PublicPath");
        internal string UserCheckInfoUploadPath => _configuration.GetValue<string>("UploadPath:UserCheckInfo");
        internal string CostInfoUploadPath => _configuration.GetValue<string>("UploadPath:CostInfo");
        internal string ProjectItemInfoUploadPath => _configuration.GetValue<string>("UploadPath:ProjectItemInfo");
        internal string ProjectBillInfoUploadPath => _configuration.GetValue<string>("UploadPath:ProjectBillInfo");
        internal string PreFinalAccountFileUploadPath => _configuration.GetValue<string>("UploadPath:PreFinalAccountFile");
        internal string AppInfoPath => _configuration.GetValue<string>("UploadPath:AppInfo");
        #endregion

        /// <summary>
        /// 最小日期
        /// </summary>
        internal DateTime MinDate => _configuration.GetValue<DateTime>("MinDate");
    }
}
